package housekeeping.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import housekeeping.pojo.Serve;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
/**
 * @version 1.0
 * @Author Du
 * @Date 2025/7/7 02:03
 * @注释
 */
@Mapper
public interface ServiceMapper extends BaseMapper<Serve> {
    @Insert("INSERT INTO service (category,discription,standard_price,standard_duration) VALUES (#{category},#{discription},#{standard_price},#{standard_duration})")
    int insertPartial(@Param("category") String category, @Param("discription") String discription, @Param("standard_price") BigDecimal standard_price, @Param("standard_duration") int standard_duration);

    @Update("UPDATE service SET category = #{category}, discription = #{discription}, standard_price = #{standard_price}, standard_duration = #{standard_duration} WHERE id = #{id}")
    int updatePartial(@Param("id") Integer id, @Param("category") String category, @Param("discription") String discription, @Param("standard_price") BigDecimal standard_price, @Param("standard_duration") int standard_duration);
}
